package com.simba.system.controller;


import com.simba.response.Result;
import com.simba.system.entity.Menu;
import com.simba.system.service.MenuService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 菜单权限表 前端控制器
 * </p>
 *
 * @author 陈俊 1002471284@qq.com
 * @since 2021-03-24
 */
@RestController
@RequestMapping("/system/menu")
public class MenuController {

    @Autowired
    private MenuService menuService;

    @ApiOperation(value = "根据登录用户id获取菜单列表")
    @GetMapping("/getMenus")
    public Result getMenusByUserId(){
        List<Menu> menus = menuService.getMenusByUserId();
        return Result.success().data("records",menus);
    }

}

